<template>
    <div id="modelView">
        <mt-header title="全文">
        <router-link to="/index/notaudit" slot="left">
        <mt-button icon="back">返回</mt-button>
        </router-link>
         </mt-header> 
      <div class="content">
          <h2>{{this.$route.query.title}}</h2>
          <h3>（校园新闻）</h3>
          <div v-if='this.$route.query.src.length>0'>
            <p style='text-align:center'>{{this.$route.query.content}}</p>
             <div v-for='item in this.$route.query.src'>
                  <img class='ssp' :src="item.src" alt="">
             </div>
          </div>
          <div v-else class="previewSubtitle" v-html="this.$route.query.content"></div>
        <!--//////////////////////预览列表////////////// -->
          <ul>
              <!-- <li v-for="item in $store.state.articalList">{{item}}</li> -->
          </ul>
      </div>
      <div class="btnArea">   
          <mt-button type="primary"  class="nopass" @click="open3">未通过</mt-button>
          <mt-button type="primary"  class="pass" @click="pass">通过</mt-button>
      </div>
       
    </div>
</template>
 <script>
     export default{
         data(){
             return {
              reason:''
                
            }
         },
         methods:{
             addArtical(){
                 this.$store.commit('articalAdd')
             },
            //  触发未通过方法
              open3() {
                this.$prompt("审核不通过原因", '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',                
                }).then(({ value }) => {
                   //this.reason=value;
                   var url="http://125.210.160.93:8080/SmEdu/priv/news/check";
                this.$http.post(url,{id:this.$route.query.id,status:false,reason:value}).then((res)=>{
                    console.log(res);
                   
                }).catch((err)=>{
                    console.log(err);
                })
                })      
            },
            // 审核通过
            pass(){
                var url="http://125.210.160.93:8080/SmEdu/priv/news/check";
                this.$http.post(url,{id:this.$route.query.id,status:true}).then((res)=>{
                    console.log(res);
                   this.$router.push({path:'/index'});
                }).catch((err)=>{
                    console.log(err);
                })
            },
        },
         
         props:['auditMsg','notAuditShow'],
         created(){
             
         }
     }
 </script>
<style>
    #modelView {
        background:#eee;
         min-height:667px; 
    }
    #modelView .content{
        width:90%;
        min-height:200px; 
        background:#fff;
        margin:0 auto;
    }
    #modelView .content h2{
        padding:0.3333rem 0;
    }
    #modelView .content h3{
        color:#E95F18;
        padding-bottom:0.2667rem;
    }
    #modelView .content p{
         text-align: left;
    }
    #modelView .btnArea{
        width:90%;
        display: flex;
        /* border:1px solid red; */
        margin:0 auto;
        padding:20px 0;
        justify-content: space-around;
    }
    #modelView .nopass{
        width:2.6667rem;
        background:#3EDA90;
    }
    #modelView .pass{
        width:2.6667rem;
    }
    #modelView .previewSubtitle{
        text-indent:2em;
        font: 14px Tahoma,Helvetica,Arial,"\5b8b\4f53",sans-serif;
      }
    #modelView .ssp{
        width: 7rem;
        height: 5rem;
        margin: 0 auto;
        display: block;
    }
    .el-message-box{
        width:350px;
    }
    .previewSubtitle img{
        width: 7rem;
        height: 5rem;
        margin: 0 auto;
        display: block;
    }
    #modelView .content img{
        width: 7rem;
        height: 5rem;
        margin: 0 auto;
        display: block;
    }
</style>


